// SupportHangerGenerator.h: interface for the SupportHangerGenerator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SUPPORTHANGERGENERATOR_H__F1353DF8_ADF5_4367_8822_FB6A90598A14__INCLUDED_)
#define AFX_SUPPORTHANGERGENERATOR_H__F1353DF8_ADF5_4367_8822_FB6A90598A14__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ProjectDBObjectGenerator.h"
#include "SupportHanger.h"
#include "SupportHangerPoint.h"
#include "Singleton.h"
#include "RecordsetPtrWrap.h"

using namespace DAWrapper;
namespace VersionControl
{
	class DllExport SupportHangerGenerator : public ProjectDBObjectGenerator 
	{
		DECLARE_SINGLETON(SupportHangerGenerator)
			
	public:
		SupportHangerGenerator();
		virtual ~SupportHangerGenerator();
		
	public:
		SupportHanger* Generate(const CString& strSHID,
			const CString& strVolumeID, const CString& strPrjID);
		
		SupportHanger* Generate(DAWrapper::RecordsetPtrWrap& rs);
		SupportHanger* Generate(const SupportHangerPoint& pt);
		SupportHanger* NewSupportHanger();
		
	public:
		BOOL ReadAllSHData(SupportHanger* pSH);
		
	private:
		void GetSHData(SupportHanger* pSH, DAWrapper::RecordsetPtrWrap& rs);
		BOOL GetSHStringSet(SupportHanger* pSH, DAWrapper::RecordsetPtrWrap& rs);
		BOOL GetSHString(SupportHanger* pSH);
		BOOL GetSHPartSet(SupportHanger* pSH, DAWrapper::RecordsetPtrWrap& rs);
		BOOL GetSHPart(SupportHanger* pSH);
		void ReadParts(SupportHanger* pSH);
		void ReadJoints(SupportHanger* pSH);
		void ReadSHProperty(SupportHanger* pSH);
		void ReadSHPropertyFromPrjDB(SupportHanger* pSH);
	};
}
using namespace VersionControl;
DllExport VersionControl::SupportHangerGenerator& GetSupportHangerGenerator();
#endif // !defined(AFX_SUPPORTHANGERGENERATOR_H__F1353DF8_ADF5_4367_8822_FB6A90598A14__INCLUDED_)
